# -*- coding: utf-8 -*-
# @Time    : 2019/06
# @Author  : XiaoXi
# @PROJECT : Aff_service

import allure
import pytest

from bin.util.file_utils import get_ini_case
from bin.util.file_utils import get_page_dir
from bin.util.read_utils import ReadFileData
from bin.util.sendcheck_utils import api_send_check

case_dict = ReadFileData().load_yaml(get_ini_case('offer', 'Template'))


@allure.feature(case_dict["test_info"]["title"])
class TestTemplate:

    @pytest.mark.parametrize("case_data", [case_dict["test_name"]], ids=[])
    @allure.story("Template")
    @pytest.mark.flaky(reruns=3, reruns_delay=3)
    def test_template(self, log, case_data):
        """
        :param case_data: 测试用例
        :return:
        """
        PATH = get_page_dir("offer")
        # 发送测试请求
        api_send_check(log, case_data, None, PATH)
